#include "main.h"
#include "Api_Pump.h"                

Pump_T      tPump;

void f_flow_water_pro(void *para)
{	
	para =para;
	
	tPump.ePump =Pump_Close;
	DO_out_Set(DO_ID_VAL_WATER,0);
	Timer_DeleteTask(TIMER_ID_ADD_WATER);
}


void Deal_Add_water(u8 Time)
{
	tPump.Add_water_Time= Time;
	tPump.ePump =Pump_Open;
	DO_out_Set(DO_ID_VAL_WATER,1);
	Timer_CreateTask(TIMER_ID_ADD_WATER, 100*tPump.Add_water_Time, f_flow_water_pro, 0, 1, 0);
}

void Deal_Add_water_Pause(void)   
{
	tPump.ePump =Pump_Close;
	DO_out_Set(DO_ID_VAL_WATER,0);
	Timer_PauseTask(TIMER_ID_ADD_WATER);
}

void Deal_Add_water_Resume(void)
{
	if(Timer_GetTimerStatus(TIMER_ID_ADD_WATER) ==TIMER_SLEEP)
	{
		tPump.ePump =Pump_Open;
		DO_out_Set(DO_ID_VAL_WATER,1);
		Timer_ResumeTask(TIMER_ID_ADD_WATER);
	}
}

void Deal_Add_water_Del(void)
{
	tPump.ePump =Pump_Close;
	DO_out_Set(DO_ID_VAL_WATER,0);
	Timer_DeleteTask(TIMER_ID_ADD_WATER);
}
